package com.lrl.security.validate.core;

import org.springframework.web.context.request.ServletWebRequest;

/**
 * 效验码处理器，封装不同效验码的处理逻辑
 * @author LRL
 */
public interface ValidateCodeProcessor {
    /**
     * 验证码放入Session时的前缀
     */
    String SESSION_KEY_PREFIX = "SESSION_KEY_FOR_CODE_";

    /**
     * 创建效验码
     * @param request
     * @throws Exception
     */
    void create(ServletWebRequest request)throws Exception;

    /**
     * 校验验证码
     *
     * @param servletWebRequest
     * @throws Exception
     */
    void validate(ServletWebRequest servletWebRequest);

}
